home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Burning & Media / GB-PVR 1.2.13 / GBPVR10213.msi / Cabs.w1.cab / Download.aspx.cs555 < prev    next >
Encoding:
Text File  |  2006-09-26  |  3.1 KB  |  117 lines

  1. //===========================================================================
  2. // This file was modified as part of an ASP.NET 2.0 Web project conversion.
  3. // The class name was changed and the class modified to inherit from the abstract base class 
  4. // in file 'App_Code\Migrated\public\Stub_download_aspx_cs.cs'.
  5. // During runtime, this allows other classes in your web application to bind and access 
  6. // the code-behind page using the abstract base class.
  7. // The associated content page 'public\download.aspx' was also modified to refer to the new class name.
  8. // For more information on this code pattern, please refer to http://go.microsoft.com/fwlink/?LinkId=46995 
  9. //===========================================================================
  10. using System;
  11. using System.Collections;
  12. using System.ComponentModel;
  13. using System.Data;
  14. using System.Drawing;
  15. using System.IO;
  16. using System.Text;
  17. using System.Web;
  18. using System.Web.SessionState;
  19. using System.Web.UI;
  20. using System.Web.UI.WebControls;
  21. using System.Web.UI.HtmlControls;
  22.  
  23. namespace gbweb
  24. {
  25.     /// <summary>
  26.     /// Summary description for Download.
  27.     /// </summary>
  28.     public partial class Migrated_PublicDownload : PublicDownload
  29.     {
  30.  
  31.         protected void Page_Load(object sender, System.EventArgs e)
  32.         {
  33.  
  34.             bool direct = Request.Params["mode"] != null;
  35.  
  36.             int rid;
  37.             if (Request.Params["rid"] != null)
  38.             {
  39.                 try
  40.                 {
  41.                     rid = (int)Deseralize(Request.Params["rid"]);
  42.                 }
  43.                 catch
  44.                 {
  45.                     return;
  46.                 }
  47.             }
  48.             else
  49.             {
  50.                 return;
  51.             }
  52.  
  53.             string path = null;
  54.             if (Request.Params["path"] != null) 
  55.             {
  56.                 try
  57.                 {
  58.                     path = (string)Deseralize(Request.Params["path"]);
  59.                 }
  60.                 catch
  61.                 {
  62.                     return;
  63.                 }
  64.             }
  65.  
  66.             Download.ProcessDownload(Request, Response, direct, rid, path);
  67.         }
  68.  
  69.         #region Web Form Designer generated code
  70.         override protected void OnInit(EventArgs e)
  71.         {
  72.             //
  73.             // CODEGEN: This call is required by the ASP.NET Web Form Designer.
  74.             //
  75.             InitializeComponent();
  76.             base.OnInit(e);
  77.         }
  78.         
  79.         /// <summary>
  80.         /// Required method for Designer support - do not modify
  81.         /// the contents of this method with the code editor.
  82.         /// </summary>
  83.         private void InitializeComponent()
  84.         {    
  85.         }
  86.         #endregion
  87.  
  88.         private static string macKeyModifier;
  89.  
  90. //        static PublicDownload()
  91.         static  Migrated_PublicDownload()
  92.         {
  93.             Random rnd = new Random();
  94.             byte[] buffer = new byte[16];
  95.             rnd.NextBytes(buffer);
  96.             macKeyModifier = Encoding.ASCII.GetString(buffer);
  97.         }
  98.  
  99.  
  100. //        public static string Serialize(object value)
  101. //        {
  102. //            LosFormatter los = new LosFormatter(true, macKeyModifier);
  103. //            MemoryStream stream = new MemoryStream();
  104. //            los.Serialize(stream, value);
  105. //            return Encoding.ASCII.GetString(stream.ToArray()).Replace("+", "-").Replace("/", "_").Replace("=", "*");
  106. //        }
  107.  
  108. //        public static object Deseralize(string input)
  109. //        {
  110. //            LosFormatter los = new LosFormatter(true, macKeyModifier);
  111. //            MemoryStream stream = new MemoryStream(Encoding.ASCII.GetBytes(input.Replace("-", "+").Replace("_", "/").Replace("*", "=")));
  112. //            return los.Deserialize(stream);
  113. //        }
  114.  
  115.     }
  116. }
  117.